/*
 * =====================================================================================
 *
 *       Filename:  
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  06/04/14 10:01:41
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Andy (gk), andy_y_li@163.com
 *        Company:  RD
 *
 * =====================================================================================
 */


#include <stdio.h>
#include <string.h>
#include "menu.h"

int main(void)
{
	char strCmd[80];

    printf("Please enter the command!\n");
    printf("use \"help\" to get the help info!\n");
    printf("use \"exit\" to exit the system!\n:-)");
    while(1)
    {
        char * s = fgets(strCmd, sizeof(strCmd), stdin); 
        if (s == NULL){
            perror("gets error");
            return -1;
        }
        printf(":-)");
        if (strlen(strCmd) == 1) {
            continue;
        }
        strCmd[strlen(strCmd) - 1] = '\0';
            
        if (is_exit_cmd(strCmd) == 0){
            printf("exit the system!\n:-)\n");
            break;
        }
        
        ExcuteCommand(strCmd);
     
    }
	return 0;
}
